{% extends "base.html" %} 

{% block main_content%}
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
    <h3 class="h3">首页</h3>
</div>

<div class="col-sm-10">
  {% if question is not None %}
          <div>
      你：{{question}}
          </div>
    {% endif %}
    {% for current_obj in object_list %}
      {% if current_obj.不带入大模型对话中 is False%}
      <div>
        {% if current_obj.role == "user" %}
          你：{{current_obj.content}}
          <hr>
        {% else %}
          AI：{{current_obj.处理后content}}
          {% if link_text is not None %}
          <div>
      参考链接：<a href="{{link_url}}" target="_blank">{{link_text}}</a> &nbsp;
          </div>
          <div class="text-right"> 
            <a href="review?conversationid={{current_obj.id}}&review=positive">好评</a> 
                &nbsp;
                <a href="review?conversationid={{current_obj.id}}&review=negative">差评</a> 
                </div>
    {% endif %}
    <hr>
        {% endif %}
      </div>
      {% endif %}
    {% endfor %}
    
    <form method="POST">
      {% csrf_token %}
      <div class="form-group row">
        <label for="inputEmail3" class="col-sm-2 col-form-label">输入你的问题</label>
        <div class="col-sm-6">
          <input type="input" class="form-control" name="question">
        </div>
        <button type="submit" class="btn btn-primary">提交</button> &nbsp;
      </div>
    </form>
    <a href="/newtalk" class="btn btn-warning">开始新的对话</a>
  </div>
  {% endblock %}